package grouplife::Schema::Result::Tuan;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use Moose;
use MooseX::NonMoose;
use namespace::autoclean;
extends 'DBIx::Class::Core';

__PACKAGE__->load_components(qw( TimeStamp Core ));
=head1 NAME

grouplife::Schema::Result::Tuan

=cut

__PACKAGE__->table("tuan");

=head1 ACCESSORS

=head2 id

  data_type: 'integer'
  is_auto_increment: 1
  is_nullable: 0

=head2 name

  data_type: 'text'
  is_nullable: 1

=head2 description

  data_type: 'text'
  is_nullable: 1

=head2 image

  data_type: 'text'
  is_nullable: 1

=cut

__PACKAGE__->add_columns(
		"id",
		{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
		"name",
		{ data_type => "text", is_nullable => 1 },
		"status",
		{ data_type => "char", is_nullable => 1 },
		"created",
                { data_type => 'datetime', timezone => "Asia/Shanghai", set_on_create => 1 },
                "updated",
                { data_type => 'datetime', timezone => "Asia/Shanghai", set_on_create => 1, set_on_update => 1 },
                "tiyan_time_from",
                { data_type => "timestamp", is_nullable => 1 },
                "tiyan_time_to",
                { data_type => "timestamp", is_nullable => 1 },
                "tiyan_location",
                { data_type => "text", is_nullable => 1 },
                "tihuo_time_from",
                { data_type => "timestamp", is_nullable => 1 },
                "tihuo_time_to",
                { data_type => "timestamp", is_nullable => 1 },
                "tihuo_location",
                { data_type => "text", is_nullable => 1 },
                "qitian",
                { data_type => "char", is_nullable => 1 },
                "tiyan",
                { data_type => "char", is_nullable => 1 },
                "zhifu",
                { data_type => "char", is_nullable => 1 },
                "pay_url",
                { data_type => "text", is_nullable => 1 },
                "zhifu_eff_to",
                { data_type => "datetime", is_nullable => 1 },
                "fahuo_eff_to",
                { data_type => "datetime", is_nullable => 1 },
                "description",
                { data_type => "text", is_nullable => 1 },
                "comm_item_id",
                { data_type => "integer", is_nullable => 1 },
                "image",
                { data_type => "varchar", is_nullable => 1 },

		); 
__PACKAGE__->set_primary_key("id");


# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-03-28 04:13:18
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K5s/JbwtWWQcqwAL6vK0xQ

__PACKAGE__->has_many(
		"tuan_stores",
		"grouplife::Schema::Result::TuanStore",
		{ "foreign.tuan_id" => "self.id" },
		);

__PACKAGE__->has_many(
		"user_tuan",
		"grouplife::Schema::Result::UserTuan",
		{ "foreign.tuan_id" => "self.id" },
		);
__PACKAGE__->has_many(
		"tuanyuan",
		"grouplife::Schema::Result::UserTuan",
		{ "foreign.tuan_id" => "self.id" },
		{where => {'role' => 'J'}}
		);
__PACKAGE__->has_many(
		"tuan_category",
		"grouplife::Schema::Result::TuanCategory",
		{ "foreign.tuan_id" => "self.id" },
		);
__PACKAGE__->has_many(
		"university_tuan",
		"grouplife::Schema::Result::UniversityTuan",
		{ "foreign.tuan_id" => "self.id" },
		);
__PACKAGE__->has_many(
                "user_tuan_stores",
                "grouplife::Schema::Result::UserTuanStore",
                { "foreign.tuan_id" => "self.id" },
                );


__PACKAGE__->many_to_many(stores => 'tuan_stores', 'stores');
__PACKAGE__->many_to_many(users => 'user_tuan', 'users');
__PACKAGE__->many_to_many(done_users => 'deal_done_users', 'users');
__PACKAGE__->many_to_many(member => 'tuanyuan', 'users');
__PACKAGE__->many_to_many(category => 'tuan_category', 'category');
__PACKAGE__->many_to_many(university => 'university_tuan', 'university');

# You can replace this text with custom code or comments, and it will be preserved on regeneration
__PACKAGE__->meta->make_immutable;
1;
